<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
  <input v-focus :value="str" type="text">
</div>
</body>
<script type="module">
  Vue.directive('focus',{
    inserted(el){
      el.focus();
    }
  })
  new Vue({
    el:"#root",
    data:{
      str:'sxxxxxx'
    }
  })
</script>
</html>